From: Philip Chimento Date: Tue, 19 Nov 2019 21:31:57 +0000 (-0800) Subject: dateMenu: Skip weather forecast if not valid X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~781^2^2~401 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=b779f6f72810ec06c4ddebf37680a6f254b61921;p=gnome-shell.git dateMenu: Skip weather forecast if not valid GWeather.Info.get_value_update() may indicate that the forecast is not valid, or it may return a timestamp of 0 to indicate the information has never been updated. In both of these cases, skip creating a widget for it, as the information will not be accurate. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/835 --- diff --git a/js/ui/dateMenu.js b/js/ui/dateMenu.js index 51413c566..17e6d1723 100644 --- a/js/ui/dateMenu.js +++ b/js/ui/dateMenu.js @@ -333,7 +333,9 @@ class WeatherSection extends St.Button { let col = 0; infos.forEach(fc => { - let [ok_, timestamp] = fc.get_value_update(); + const [valid, timestamp] = fc.get_value_update(); + if (!valid || timestamp === 0) + return; // 0 means 'never updated' let timeStr = Util.formatTime(new Date(timestamp * 1000), { timeOnly: true, ampm: false,